Optimal. Leaf size=331 \[ \frac{\log \left (-\sqrt{2} \sqrt [4]{a} x \sqrt{\sqrt{a+b}-\sqrt{a}}+\sqrt{a+b}+\sqrt{a} x^2\right )}{4 \sqrt{2} a^{3/4} \sqrt{\sqrt{a+b}-\sqrt{a}}}-\frac{\log \left (\sqrt{2} \sqrt [4]{a} x \sqrt{\sqrt{a+b}-\sqrt{a}}+\sqrt{a+b}+\sqrt{a} x^2\right )}{4 \sqrt{2} a^{3/4} \sqrt{\sqrt{a+b}-\sqrt{a}}}-\frac{\tan ^{-1}\left (\frac{\sqrt{\sqrt{a+b}-\sqrt{a}}-\sqrt{2} \sqrt [4]{a} x}{\sqrt{\sqrt{a+b}+\sqrt{a}}}\right )}{2 \sqrt{2} a^{3/4} \sqrt{\sqrt{a+b}+\sqrt{a}}}+\frac{\tan ^{-1}\left (\frac{\sqrt{\sqrt{a+b}-\sqrt{a}}+\sqrt{2} \sqrt [4]{a} x}{\sqrt{\sqrt{a+b}+\sqrt{a}}}\right )}{2 \sqrt{2} a^{3/4} \sqrt{\sqrt{a+b}+\sqrt{a}}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.255547, antiderivative size = 331, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 5, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {1129, 634, 618, 204, 628} \[ \frac{\log \left (-\sqrt{2} \sqrt [4]{a} x \sqrt{\sqrt{a+b}-\sqrt{a}}+\sqrt{a+b}+\sqrt{a} x^2\right )}{4 \sqrt{2} a^{3/4} \sqrt{\sqrt{a+b}-\sqrt{a}}}-\frac{\log \left (\sqrt{2} \sqrt [4]{a} x \sqrt{\sqrt{a+b}-\sqrt{a}}+\sqrt{a+b}+\sqrt{a} x^2\right )}{4 \sqrt{2} a^{3/4} \sqrt{\sqrt{a+b}-\sqrt{a}}}-\frac{\tan ^{-1}\left (\frac{\sqrt{\sqrt{a+b}-\sqrt{a}}-\sqrt{2} \sqrt [4]{a} x}{\sqrt{\sqrt{a+b}+\sqrt{a}}}\right )}{2 \sqrt{2} a^{3/4} \sqrt{\sqrt{a+b}+\sqrt{a}}}+\frac{\tan ^{-1}\left (\frac{\sqrt{\sqrt{a+b}-\sqrt{a}}+\sqrt{2} \sqrt [4]{a} x}{\sqrt{\sqrt{a+b}+\sqrt{a}}}\right )}{2 \sqrt{2} a^{3/4} \sqrt{\sqrt{a+b}+\sqrt{a}}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1129
Rule 634
Rule 618
Rule 204
Rule 628
Rubi steps
\begin{align*} \int \frac{x^2}{a+b+2 a x^2+a x^4} \, dx &=\frac{\int \frac{x}{\frac{\sqrt{a+b}}{\sqrt{a}}-\frac{\sqrt{2} \sqrt{-\sqrt{a}+\sqrt{a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{2 \sqrt{2} a^{3/4} \sqrt{-\sqrt{a}+\sqrt{a+b}}}-\frac{\int \frac{x}{\frac{\sqrt{a+b}}{\sqrt{a}}+\frac{\sqrt{2} \sqrt{-\sqrt{a}+\sqrt{a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{2 \sqrt{2} a^{3/4} \sqrt{-\sqrt{a}+\sqrt{a+b}}}\\ &=\frac{\int \frac{1}{\frac{\sqrt{a+b}}{\sqrt{a}}-\frac{\sqrt{2} \sqrt{-\sqrt{a}+\sqrt{a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{4 a}+\frac{\int \frac{1}{\frac{\sqrt{a+b}}{\sqrt{a}}+\frac{\sqrt{2} \sqrt{-\sqrt{a}+\sqrt{a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{4 a}+\frac{\int \frac{-\frac{\sqrt{2} \sqrt{-\sqrt{a}+\sqrt{a+b}}}{\sqrt [4]{a}}+2 x}{\frac{\sqrt{a+b}}{\sqrt{a}}-\frac{\sqrt{2} \sqrt{-\sqrt{a}+\sqrt{a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{4 \sqrt{2} a^{3/4} \sqrt{-\sqrt{a}+\sqrt{a+b}}}-\frac{\int \frac{\frac{\sqrt{2} \sqrt{-\sqrt{a}+\sqrt{a+b}}}{\sqrt [4]{a}}+2 x}{\frac{\sqrt{a+b}}{\sqrt{a}}+\frac{\sqrt{2} \sqrt{-\sqrt{a}+\sqrt{a+b}} x}{\sqrt [4]{a}}+x^2} \, dx}{4 \sqrt{2} a^{3/4} \sqrt{-\sqrt{a}+\sqrt{a+b}}}\\ &=\frac{\log \left (\sqrt{a+b}-\sqrt{2} \sqrt [4]{a} \sqrt{-\sqrt{a}+\sqrt{a+b}} x+\sqrt{a} x^2\right )}{4 \sqrt{2} a^{3/4} \sqrt{-\sqrt{a}+\sqrt{a+b}}}-\frac{\log \left (\sqrt{a+b}+\sqrt{2} \sqrt [4]{a} \sqrt{-\sqrt{a}+\sqrt{a+b}} x+\sqrt{a} x^2\right )}{4 \sqrt{2} a^{3/4} \sqrt{-\sqrt{a}+\sqrt{a+b}}}-\frac{\operatorname{Subst}\left (\int \frac{1}{-2 \left (1+\frac{\sqrt{a+b}}{\sqrt{a}}\right )-x^2} \, dx,x,-\frac{\sqrt{2} \sqrt{-\sqrt{a}+\sqrt{a+b}}}{\sqrt [4]{a}}+2 x\right )}{2 a}-\frac{\operatorname{Subst}\left (\int \frac{1}{-2 \left (1+\frac{\sqrt{a+b}}{\sqrt{a}}\right )-x^2} \, dx,x,\frac{\sqrt{2} \sqrt{-\sqrt{a}+\sqrt{a+b}}}{\sqrt [4]{a}}+2 x\right )}{2 a}\\ &=-\frac{\tan ^{-1}\left (\frac{\sqrt{-\sqrt{a}+\sqrt{a+b}}-\sqrt{2} \sqrt [4]{a} x}{\sqrt{\sqrt{a}+\sqrt{a+b}}}\right )}{2 \sqrt{2} a^{3/4} \sqrt{\sqrt{a}+\sqrt{a+b}}}+\frac{\tan ^{-1}\left (\frac{\sqrt{-\sqrt{a}+\sqrt{a+b}}+\sqrt{2} \sqrt [4]{a} x}{\sqrt{\sqrt{a}+\sqrt{a+b}}}\right )}{2 \sqrt{2} a^{3/4} \sqrt{\sqrt{a}+\sqrt{a+b}}}+\frac{\log \left (\sqrt{a+b}-\sqrt{2} \sqrt [4]{a} \sqrt{-\sqrt{a}+\sqrt{a+b}} x+\sqrt{a} x^2\right )}{4 \sqrt{2} a^{3/4} \sqrt{-\sqrt{a}+\sqrt{a+b}}}-\frac{\log \left (\sqrt{a+b}+\sqrt{2} \sqrt [4]{a} \sqrt{-\sqrt{a}+\sqrt{a+b}} x+\sqrt{a} x^2\right )}{4 \sqrt{2} a^{3/4} \sqrt{-\sqrt{a}+\sqrt{a+b}}}\\ \end{align*}
Mathematica [C] time = 0.116752, size = 143, normalized size = 0.43 \[ \frac{\frac{\left (\sqrt{b}+i \sqrt{a}\right ) \tan ^{-1}\left (\frac{\sqrt{a} x}{\sqrt{a-i \sqrt{a} \sqrt{b}}}\right )}{\sqrt{a-i \sqrt{a} \sqrt{b}}}+\frac{\left (\sqrt{b}-i \sqrt{a}\right ) \tan ^{-1}\left (\frac{\sqrt{a} x}{\sqrt{a+i \sqrt{a} \sqrt{b}}}\right )}{\sqrt{a+i \sqrt{a} \sqrt{b}}}}{2 \sqrt{a} \sqrt{b}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.159, size = 724, normalized size = 2.2 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x^{2}}{a x^{4} + 2 \, a x^{2} + a + b}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.52766, size = 633, normalized size = 1.91 \begin{align*} \frac{1}{4} \, \sqrt{\frac{a b \sqrt{-\frac{1}{a^{3} b}} + 1}{a b}} \log \left (a^{2} b \sqrt{\frac{a b \sqrt{-\frac{1}{a^{3} b}} + 1}{a b}} \sqrt{-\frac{1}{a^{3} b}} + x\right ) - \frac{1}{4} \, \sqrt{\frac{a b \sqrt{-\frac{1}{a^{3} b}} + 1}{a b}} \log \left (-a^{2} b \sqrt{\frac{a b \sqrt{-\frac{1}{a^{3} b}} + 1}{a b}} \sqrt{-\frac{1}{a^{3} b}} + x\right ) - \frac{1}{4} \, \sqrt{-\frac{a b \sqrt{-\frac{1}{a^{3} b}} - 1}{a b}} \log \left (a^{2} b \sqrt{-\frac{a b \sqrt{-\frac{1}{a^{3} b}} - 1}{a b}} \sqrt{-\frac{1}{a^{3} b}} + x\right ) + \frac{1}{4} \, \sqrt{-\frac{a b \sqrt{-\frac{1}{a^{3} b}} - 1}{a b}} \log \left (-a^{2} b \sqrt{-\frac{a b \sqrt{-\frac{1}{a^{3} b}} - 1}{a b}} \sqrt{-\frac{1}{a^{3} b}} + x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.355501, size = 44, normalized size = 0.13 \begin{align*} \operatorname{RootSum}{\left (256 t^{4} a^{3} b^{2} - 32 t^{2} a^{2} b + a + b, \left ( t \mapsto t \log{\left (64 t^{3} a^{2} b - 4 t a + x \right )} \right )\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: NotImplementedError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]